home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / tcl / tcl70b2.lha / tcl7.0b2 / README < prev    next >
Text File  |  1993-07-19  |  15KB  |  323 lines

  1. Tcl
  2.  
  3. by John Ousterhout
  4. University of California at Berkeley
  5. ouster@cs.berkeley.edu
  6.  
  7. 1. Introduction
  8. ---------------
  9.  
  10. This directory contains the sources and documentation for Tcl, an
  11. embeddable tool command language.  The information here corresponds
  12. to release 7.0b2, the first beta release of Tcl 7.0.
  13.  
  14. 2. Documentation
  15. ----------------
  16.  
  17. The best way to get started with Tcl is to read the draft of my
  18. upcoming book on Tcl and Tk, which can be retrieved using anonymous
  19. FTP from the directory "tcl" on sprite.berkeley.edu.  Part I of the
  20. book provides an introduction to writing Tcl scripts and Part III
  21. describes how to write C code that uses the Tcl C library procedures.
  22.  
  23. The "doc" subdirectory in this release contains a complete set of manual
  24. entries for Tcl.  Files with extension ".1" are for programs (for
  25. example, tclsh.1); files with extension ".3" are for C library procedures;
  26. and files with extension ".n" describe Tcl commands. The file "doc/Tcl.n"
  27. gives a quick summary of the Tcl language syntax.  To print any of the man
  28. pages, cd to the "doc" directory and invoke your favorite variant of
  29. troff using the normal -man macros, for example
  30.  
  31.         ditroff -man Tcl.n
  32.  
  33. to print Tcl.n.  If Tcl has been installed correctly and your "man"
  34. program supports it, you should be able to access the Tcl manual entries
  35. using the normal "man" mechanisms, such as
  36.  
  37.         man Tcl
  38.  
  39. 3. Compiling and installing Tcl
  40. -------------------------------
  41.  
  42. This release should compile and run "out of the box" on any UNIX-like
  43. system that approximates POSIX, BSD, or System V.  I know that it runs
  44. on workstations from Sun, DEC, H-P, IBM, and Silicon Graphics, and on
  45. PC's running SCO UNIX and Xenix.  To compile Tcl, do the following:
  46.  
  47.     (a) Type "./configure" in this directory.  This runs a configuration
  48.     script created by GNU autoconf, which configures Tcl for your
  49.     system and creates a Makefile.
  50.     
  51.     (b) Type "make".  This will create a library archive called "libtcl.a"
  52.     and an interpreter application called "tclsh" that allows you to type
  53.     Tcl commands interactively or execute script files.
  54.  
  55.     (c) If the make fails then you'll have to personalize the Makefile
  56.         for your site or possibly modify the distribution in other ways.
  57.     First check the file "porting.notes" to see if there are hints
  58.     for compiling on your system.  If you need to modify Makefile,
  59.     there are comments at the beginning of it that describe the things
  60.     you might want to change and how to change them.
  61.  
  62.     (d) Type "make install" to install Tcl binaries and script files in
  63.         standard places.  You'll need write permission on /usr/local to
  64.     do this.  See the Makefile for details on where things get
  65.     installed.
  66.  
  67.     (e) At this point you can play with Tcl by invoking the "tclsh"
  68.     program and typing Tcl commands.  However, if you haven't installed
  69.     Tcl then you'll first need to set your TCL_LIBRARY variable to
  70.     hold the full path name of the "library" subdirectory.
  71.  
  72. If you have trouble compiling Tcl, I'd suggest looking at the file
  73. "porting.notes".  It contains information that people have sent me about
  74. changes they had to make to compile Tcl in various environments.  I make
  75. no guarantees that this information is accurate, complete, or up-to-date,
  76. but you may find it useful.  If you get Tcl running on a new configuration,
  77. I'd be happy to receive new information to add to "porting.notes".  I'm
  78. also interested in hearing how to change the configuration setup so that
  79. Tcl compiles on additional platforms "out of the box".
  80.  
  81. 4. Test suite
  82. -------------
  83.  
  84. There is a relatively complete test suite for all of the Tcl core in
  85. the subdirectory "tests".  To use it just type "make test" in this
  86. directory.  You should then see a printout of the test files processed.
  87. If any errors occur, you'll see a much more substantial printout for
  88. each error.  See the README file in the "tests" directory for more
  89. information on the test suite.
  90.  
  91. 5. Summary of changes in this release
  92. ------------------------------------------
  93.  
  94. Tcl 7.0 is a major new release that includes several new features
  95. and a few incompatible changes.  For a complete list of all changes
  96. to Tcl in chronological order, see the file "changes".  Those changes
  97. likely to cause compatibility problems with existing C code or Tcl
  98. scripts are specially marked.  The most important changes are
  99. summarized below.
  100.  
  101. Tcl configuration and installation has improved in several ways:
  102.  
  103.     1. GNU autoconf is now used for configuring Tcl prior to compilation.
  104.  
  105.     2. The "tclTest" program no longer exists.  It has been replaced by
  106.     "tclsh", which is a true shell-like program based around Tcl (tclTest
  107.     didn't really work very well as a shell).  There's a new program
  108.     "tcltest" which is the same as "tclsh" except that it includes a
  109.     few extra Tcl commands for testing purposes.
  110.  
  111.     3. A new procedure Tcl_AppInit has been added to separate all of the
  112.     application-specific initialization from the Tcl main program.  This
  113.     should make it easier to build new Tcl applications that include
  114.     extra packages.
  115.  
  116.     4. There are now separate manual entries for each of the built-in
  117.     commands.  The manual entry "Tcl.n", which used to describe all of
  118.     the built-ins plus many other things, now contains a terse but
  119.     complete description of the Tcl language syntax.
  120.  
  121. Here is a list of all incompatibilities that affect Tcl scripts:
  122.  
  123.     1. There have been several changes to backslash processing:
  124.     - Unknown backslash sequences such as "\*" are now replaced with
  125.       the following character (such as "*");  Tcl used to treat the
  126.       backslash as an ordinary character in these cases, so both the
  127.       backslash and the following character would be passed through.
  128.     - Backslash-newline now eats up any white space after the newline,
  129.       replacing the whole sequence with a single space character.  Tcl
  130.       used to just remove the backslash and newline.
  131.     - The obsolete sequences \Cx, \Mx, \CMx, and \e no longer get
  132.       special treatment.
  133.     - The "format" command no longer does backslash processing on
  134.       its input string.
  135.     You can invoke the csh command below to locate backslash uses that
  136.     may potentially behave differently under Tcl 7.0.  This command
  137.     will print all of the lines from the script files "*.tcl" that may
  138.     not work correctly under Tcl 7.0:
  139.     egrep '(\\$)|(\\[^][bfnrtv\0-9{}$ ;"])' *.tcl
  140.     In some cases the command may print lines that are actually OK.
  141.  
  142.     2. The "glob" command now returns only the names of files that
  143.     actually exist, and it only returns names ending in "/" for files
  144.     that are directories.
  145.  
  146.     3. When Tcl prints floating-point numbers (e.g. in the "expr" command)
  147.     it ensures that the numbers contain a "." or "e" so that they don't
  148.     look like integers.
  149.  
  150.     4. The "regsub" command now overwrites its result variable in all cases.
  151.     If there is no match, then the source string is copied to the result.
  152.  
  153.     5. The "exec", "glob", "regexp", and "regsub" commands now include a
  154.     "--" switch;  if the first non-switch argument starts with a "-" then
  155.     there must be a "--" switch or the non-switch argument will be treated
  156.     as a switch.
  157.  
  158.     6. The keyword "UNIX" in the variable "errorCode" has been changed to
  159.     "POSIX".
  160.  
  161.     7. The "format" and "scan" commands no longer support capitalized
  162.     conversion specifiers such as "%D" that aren't supported by ANSI
  163.     sprintf and sscanf.
  164.  
  165. Here is a list of all of the incompatibilities that affect C code that
  166. uses the Tcl library procedures.  If you use an ANSI C compiler then
  167. any potential problems will be detected when you compile your code:  if
  168. your code compiles cleanly then you don't need to worry about anything.
  169.  
  170.     1. Tcl_TildeString now takes a dynamic string as an argument, which is
  171.     used to hold the result.
  172.     
  173.     2. tclHash.h has been eliminated;  its contents are now in tcl.h.
  174.  
  175.     3. The Tcl_History command has been eliminated:  the "history" command
  176.     is now automatically part of the interpreter.
  177.  
  178.     4. The Tcl_Fork and Tcl_WaitPids procedures have been deleted (just
  179.     use fork and waitpid instead).
  180.  
  181.     5. The "flags" and "termPtr" arguments to Tcl_Eval have been eliminated,
  182.     as has the "noSep" argument to Tcl_AppendElement and the TCL_NO_SPACE
  183.     flag for Tcl_SetVar and Tcl_SetVar2.
  184.  
  185.     6. The Tcl_CmdBuf structure has been eliminated, along with the procedures
  186.     Tcl_CreateCmdBuf, Tcl_DeleteCmdBuf, and Tcl_AssembleCmd.  Use dynamic
  187.     strings instead.
  188.     
  189.     7. Tcl_SetVar and Tcl_UnsetVar2 now return TCL_OK or TCL_ERROR instead
  190.     of 0 or -1.
  191.  
  192.     8. Tcl_UnixError has been renamed to Tcl_PosixError.
  193.  
  194.     9. Tcl no longer redefines the library procedures "setenv", "putenv",
  195.     and "unsetenv" by default.  You have to set up special configuration
  196.     in the Makefile if you want this.
  197.  
  198. Below is a sampler of the most important new features in Tcl 7.0.  Refer
  199. to the "changes" file for a complete list.
  200.  
  201.     1. The "expr" command supports transcendental and other math functions,
  202.     plus it allows you to type expressions in multiple arguments.  Its
  203.     numerics have also been improved in several ways (e.g. support for
  204.     NaN).
  205.  
  206.     2. The "format" command now supports XPG3 %n$ conversion specifiers.
  207.  
  208.     3. The "exec" command supports many new kinds of redirection such as
  209.     >> and >&, plus it allows you to leave out the space between operators
  210.     like < and the file name.  For processes put into the background,
  211.     "exec" returns a list of process ids.
  212.  
  213.     4. The "lsearch" command now supports regular expressions and exact
  214.     matching.
  215.  
  216.     5. The "lsort" command has several new switches to control the
  217.     sorting process (e.g. numerical sort, user-provided sort function,
  218.     reverse sort, etc.).
  219.  
  220.     6. There's a new command "pid" that can be used to return the current
  221.     process ids or the process ids from an open file that refers to a
  222.     pipeline.
  223.  
  224.     7. There's a new command "switch" that should now be used instead
  225.     of "case".  It supports regular expressions and exact matches, and
  226.     also uses single patterns instead of pattern lists.  "Case" is
  227.     now deprecated, although it's been retained for compatibility.
  228.  
  229.     8. A new dynamic string library has been added to make it easier to
  230.     build up strings and lists of arbitrary length.  See the manual entry
  231.     "DString.3".
  232.  
  233.     9. Variable handling has been improved in several ways:  you can
  234.     now use whole-array traces to create variables on demand, you can
  235.     delete variables during traces, you can upvar to array elements,
  236.     and you can retarget an upvar variable to stop through a sequence
  237.     of variables.  Also, there's a new library procedure Tcl_LinkVar
  238.     that can be used to associated a C variable with a Tcl variable and
  239.     keep them in sync.
  240.  
  241.     10. New library procedures Tcl_SetCommandInfo and Tcl_GetCommandInfo
  242.     allow you to set and get the clientData and callback procedure for
  243.     a command.
  244.  
  245. 6. Tcl newsgroup
  246. -----------------
  247.  
  248. There is a network news group "comp.lang.tcl" intended for the exchange
  249. of information about Tcl, Tk, and related applications.  Feel free to use
  250. the newsgroup both for general information questions and for bug reports.
  251. I read the newsgroup and will attempt to fix bugs and problems reported
  252. to it.
  253.  
  254. 7. Tcl contributed archive
  255. --------------------------
  256.  
  257. Many people have created exciting packages and applications based on Tcl
  258. and made them freely available to the Tcl community.  An archive of these
  259. contributions is kept on the machine harbor.ecn.purdue.edu.  You can
  260. access the archive using anonymous FTP;  the Tcl contributed archive is
  261. in the directory "pub/tcl".
  262.  
  263. 8. Support and bug fixes
  264. ------------------------
  265.  
  266. I'm very interested in receiving bug reports and suggestions for
  267. improvements.  Bugs usually get fixed quickly (particularly if they
  268. are serious), but enhancements may take a while and may not happen at
  269. all unless there is widespread support for them (I'm trying to slow
  270. the rate at which Tcl turns into a kitchen sink).  It's almost impossible
  271. to make incompatible changes to Tcl at this point.
  272.  
  273. The Tcl community is too large for me to provide much individual
  274. support for users.  If you need help I suggest that you post questions
  275. to comp.lang.tcl.  I read the newsgroup and will attempt to answer
  276. esoteric questions for which no-one else is likely to know the answer.
  277. In addition, Tcl support and training are available commercially from
  278. NeoSoft.  For more information, send e-mail to "info@neosoft.com".
  279.  
  280. 9. Tcl release organization
  281. ---------------------------
  282.  
  283. Each Tcl release is identified by two numbers separated by a dot, e.g.
  284. 6.7 or 7.0.  If a new release contains changes that are likely to break
  285. existing C code or Tcl scripts then the major release number increments
  286. and the minor number resets to zero: 6.0, 7.0, etc.  If a new release
  287. contains only bug fixes and compatible changes, then the minor number
  288. increments without changing the major number, e.g. 7.1, 7.2, etc.  If
  289. you have C code or Tcl scripts that work with release X.Y, then they
  290. should also work with any release X.Z as long as Z > Y.
  291.  
  292. Beta releases have an additional suffix of the form bx.  For example,
  293. Tcl 7.0b1 is the first beta release of Tcl version 7.0, Tcl 7.0b2 is
  294. the second beta release, and so on.  A beta release is an initial
  295. version of a new release, used to fix bugs and bad features before
  296. declaring the release stable.  Each new release will be preceded by
  297. one or more beta releases.  I hope that lots of people will try out
  298. the beta releases and report problems back to me.  I'll make new beta
  299. releases to fix the problems, until eventually there is a beta release
  300. that appears to be stable.  Once this occurs I'll remove the beta
  301. suffix so that the last beta release becomes the official release.
  302.  
  303. If a new release contains incompatibilities (e.g. 7.0) then I can't
  304. promise to maintain compatibility among its beta releases.  For example,
  305. release 7.0b2 may not be backward compatible with 7.0b1.  I'll try
  306. to minimize incompatibilities between beta releases, but if a major
  307. problem turns up then I'll fix it even if it introduces an
  308. incompatibility.  Once the official release is made then there won't
  309. be any more incompatibilities until the next release with a new major
  310. version number.
  311.  
  312. 10. Compiling on non-UNIX systems
  313. --------------------------------
  314.  
  315. The Tcl features that depend on system calls peculiar to UNIX (stat,
  316. fork, exec, times, etc.) are now separate from the main body of Tcl,
  317. which only requires a few generic library procedures such as malloc
  318. and strcpy.  Thus it should be relatively easy to compile Tcl for
  319. non-UNIX machines such as MACs and DOS PC's, although a number of
  320. UNIX-specific commands will be absent (e.g.  exec, time, and glob).
  321. See the comments at the top of Makefile for information on how to
  322. compile without the UNIX features.
  323.